\hypertarget{classcPermElem}{\section{c\-Perm\-Elem Class Reference}
\label{classcPermElem}\index{c\-Perm\-Elem@{c\-Perm\-Elem}}
}


{\ttfamily \#include $<$permutation.\-h$>$}



Collaboration diagram for c\-Perm\-Elem\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{classcPermElem__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classcPermElem_a9170fa558dd3cdfae7879631db41235d}{c\-Perm\-Elem} ()
\item 
\hyperlink{classcPermElem_ad3ff2e93580acca710249f0eb7e04bc3}{c\-Perm\-Elem} (std\-::size\-\_\-t size)
\item 
\hyperlink{classcPermElem_a375e3da4877dd48e93ca192bfcd66ddd}{c\-Perm\-Elem} (std\-::size\-\_\-t size, const std\-::initializer\-\_\-list$<$ std\-::size\-\_\-t $>$ \&perm\-\_\-sq)
\item 
\hyperlink{classcPermElem_a88b976442227c8da9ede9cf9d3f865c5}{c\-Perm\-Elem} (const std\-::initializer\-\_\-list$<$ std\-::size\-\_\-t $>$ \&perm\-\_\-sq)
\item 
\hyperlink{classcPermElem_a05895c11888d83bc3d35b3c18d90e8e4}{c\-Perm\-Elem} (std\-::vector$<$ std\-::size\-\_\-t $>$ \&perm\-\_\-sq)
\item 
const std\-::vector$<$ std\-::size\-\_\-t $>$ \& \hyperlink{classcPermElem_a1b5d12f8fb6131643253f5ed3bad6c28}{Get\-Permutation\-Array} () const 
\item 
\hyperlink{classcPermElem}{c\-Perm\-Elem} \hyperlink{classcPermElem_a19da6e521f8adf3d252250f3836c563e}{operator$\ast$} (const \hyperlink{classcPermElem}{c\-Perm\-Elem} \&perm) const 
\item 
\hypertarget{classcPermElem_a925aac2e4ac73ec288b7a1e16b941d40}{bool {\bfseries operator==} (const \hyperlink{classcPermElem}{c\-Perm\-Elem} \&perm) const }\label{classcPermElem_a925aac2e4ac73ec288b7a1e16b941d40}

\item 
\hypertarget{classcPermElem_a925cdee12dcc4914417143a88d91c49d}{bool {\bfseries operator!=} (const \hyperlink{classcPermElem}{c\-Perm\-Elem} \&perm) const }\label{classcPermElem_a925cdee12dcc4914417143a88d91c49d}

\item 
void \hyperlink{classcPermElem_afa5694d1831e653f4cc3b12de6bb058e}{rotate\-Left} ()
\item 
std\-::size\-\_\-t \hyperlink{classcPermElem_adad3b042383cf3538bfec790188987c3}{Get\-Image} (const std\-::size\-\_\-t set\-\_\-element) const 
\item 
\hyperlink{classcPermElem}{c\-Perm\-Elem} \hyperlink{classcPermElem_adbb23b8a368e0d01cd2b450ad0be5efb}{Get\-Mult\-Inverse} () const 
\item 
\hyperlink{classcPermElem}{c\-Perm\-Elem} \hyperlink{classcPermElem_a11cc987f70282d2984c04c6e058c41e8}{Get\-Ad\-Inverse} () const 
\item 
\hypertarget{classcPermElem_a773fc9acee08d4c86d391439574eaf3e}{std\-::size\-\_\-t {\bfseries Get\-Size} () const }\label{classcPermElem_a773fc9acee08d4c86d391439574eaf3e}

\item 
{\footnotesize template$<$typename B\-I\-N\-O\-P $>$ }\\\hyperlink{classcPermElem}{c\-Perm\-Elem} \hyperlink{classcPermElem_a7f5392e3279b766d5f85c01d363c2941}{Get\-Identity} (B\-I\-N\-O\-P binop) const 
\item 
std\-::size\-\_\-t \hyperlink{classcPermElem_a06f75de000ad4b9524116a029800ca26}{Get\-Inversions} () const 
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classcPermElem_abefedad75d8175a886b30a6d36a0eb98}{Count\-Inversions} (std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator begin, std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator end, std\-::size\-\_\-t \&inversions) const 
\item 
void \hyperlink{classcPermElem_aa39ae9f1b4d3efd38616ff822caebbb9}{Merge\-Inversions} (std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator begin, std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator begin\-\_\-right, std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator end, std\-::size\-\_\-t \&inversions) const 
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcPermElem_a9a8f181852cd76a706631b5283342c7f}{std\-::vector$<$ std\-::size\-\_\-t $>$ {\bfseries m\-\_\-\-Perm\-Array}}\label{classcPermElem_a9a8f181852cd76a706631b5283342c7f}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcPermElem_a4211aa547f8e3f2dc6b44ad07f7224db}{std\-::ostream \& {\bfseries operator$<$$<$} (std\-::ostream \&of, const \hyperlink{classcPermElem}{c\-Perm\-Elem} \&perm)}\label{classcPermElem_a4211aa547f8e3f2dc6b44ad07f7224db}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
class representing a permutation (element) permutation is represented internally using an array of ints 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classcPermElem_a9170fa558dd3cdfae7879631db41235d}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!c\-Perm\-Elem@{c\-Perm\-Elem}}
\index{c\-Perm\-Elem@{c\-Perm\-Elem}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{c\-Perm\-Elem}]{\setlength{\rightskip}{0pt plus 5cm}c\-Perm\-Elem\-::c\-Perm\-Elem (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a9170fa558dd3cdfae7879631db41235d}
default constructor for empty permutation \hypertarget{classcPermElem_ad3ff2e93580acca710249f0eb7e04bc3}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!c\-Perm\-Elem@{c\-Perm\-Elem}}
\index{c\-Perm\-Elem@{c\-Perm\-Elem}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{c\-Perm\-Elem}]{\setlength{\rightskip}{0pt plus 5cm}c\-Perm\-Elem\-::c\-Perm\-Elem (
\begin{DoxyParamCaption}
\item[{std\-::size\-\_\-t}]{size}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_ad3ff2e93580acca710249f0eb7e04bc3}
constructor for identity permutation \hypertarget{classcPermElem_a375e3da4877dd48e93ca192bfcd66ddd}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!c\-Perm\-Elem@{c\-Perm\-Elem}}
\index{c\-Perm\-Elem@{c\-Perm\-Elem}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{c\-Perm\-Elem}]{\setlength{\rightskip}{0pt plus 5cm}c\-Perm\-Elem\-::c\-Perm\-Elem (
\begin{DoxyParamCaption}
\item[{std\-::size\-\_\-t}]{size, }
\item[{const std\-::initializer\-\_\-list$<$ std\-::size\-\_\-t $>$ \&}]{perm\-\_\-sq}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a375e3da4877dd48e93ca192bfcd66ddd}
constructor for permutation given as a cycle using initializer\-\_\-list ie. (3,\{1,3,2\}) means 1-\/$>$3 3-\/$>$2 2-\/$>$1 \hypertarget{classcPermElem_a88b976442227c8da9ede9cf9d3f865c5}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!c\-Perm\-Elem@{c\-Perm\-Elem}}
\index{c\-Perm\-Elem@{c\-Perm\-Elem}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{c\-Perm\-Elem}]{\setlength{\rightskip}{0pt plus 5cm}c\-Perm\-Elem\-::c\-Perm\-Elem (
\begin{DoxyParamCaption}
\item[{const std\-::initializer\-\_\-list$<$ std\-::size\-\_\-t $>$ \&}]{perm\-\_\-sq}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a88b976442227c8da9ede9cf9d3f865c5}
constructor for permutation given as an image using initializer\-\_\-list ie. \{2,3,1\} means 1-\/$>$2 2-\/$>$3 3-\/$>$1 \hypertarget{classcPermElem_a05895c11888d83bc3d35b3c18d90e8e4}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!c\-Perm\-Elem@{c\-Perm\-Elem}}
\index{c\-Perm\-Elem@{c\-Perm\-Elem}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{c\-Perm\-Elem}]{\setlength{\rightskip}{0pt plus 5cm}c\-Perm\-Elem\-::c\-Perm\-Elem (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$ \&}]{perm\-\_\-sq}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a05895c11888d83bc3d35b3c18d90e8e4}
constructor for permutation given as an image using a vector ie. vector a = \{2,3,1\} is the permutation 1-\/$>$2 2-\/$>$3 3-\/$>$1 

\subsection{Member Function Documentation}
\hypertarget{classcPermElem_abefedad75d8175a886b30a6d36a0eb98}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Count\-Inversions@{Count\-Inversions}}
\index{Count\-Inversions@{Count\-Inversions}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Count\-Inversions}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Perm\-Elem\-::\-Count\-Inversions (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator}]{begin, }
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator}]{end, }
\item[{std\-::size\-\_\-t \&}]{inversions}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}}\label{classcPermElem_abefedad75d8175a886b30a6d36a0eb98}
helper function for Get\-Inversions -- modified merge sort Complexity\-: O(nlgn) 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_abefedad75d8175a886b30a6d36a0eb98_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_a11cc987f70282d2984c04c6e058c41e8}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Ad\-Inverse@{Get\-Ad\-Inverse}}
\index{Get\-Ad\-Inverse@{Get\-Ad\-Inverse}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Ad\-Inverse}]{\setlength{\rightskip}{0pt plus 5cm}{\bf c\-Perm\-Elem} c\-Perm\-Elem\-::\-Get\-Ad\-Inverse (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a11cc987f70282d2984c04c6e058c41e8}
the same as Get\-Mult\-Inverse -- defined for consistency 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_a11cc987f70282d2984c04c6e058c41e8_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_a7f5392e3279b766d5f85c01d363c2941}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Identity@{Get\-Identity}}
\index{Get\-Identity@{Get\-Identity}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Identity}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename B\-I\-N\-O\-P $>$ {\bf c\-Perm\-Elem} c\-Perm\-Elem\-::\-Get\-Identity (
\begin{DoxyParamCaption}
\item[{B\-I\-N\-O\-P}]{binop}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a7f5392e3279b766d5f85c01d363c2941}
returns the identity permutation with the same size as the current permutation 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_a7f5392e3279b766d5f85c01d363c2941_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_adad3b042383cf3538bfec790188987c3}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Image@{Get\-Image}}
\index{Get\-Image@{Get\-Image}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Image}]{\setlength{\rightskip}{0pt plus 5cm}std\-::size\-\_\-t c\-Perm\-Elem\-::\-Get\-Image (
\begin{DoxyParamCaption}
\item[{const std\-::size\-\_\-t}]{set\-\_\-element}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_adad3b042383cf3538bfec790188987c3}
get the image of an element under the action of the permution \hypertarget{classcPermElem_a06f75de000ad4b9524116a029800ca26}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Inversions@{Get\-Inversions}}
\index{Get\-Inversions@{Get\-Inversions}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Inversions}]{\setlength{\rightskip}{0pt plus 5cm}std\-::size\-\_\-t c\-Perm\-Elem\-::\-Get\-Inversions (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a06f75de000ad4b9524116a029800ca26}
returns the number of inverses\-: \char`\"{}inverse\char`\"{} if i $<$ j and A\mbox{[}i\mbox{]} $>$ A\mbox{[}j\mbox{]} modified merge sort =$>$ Complexity\-: O(nlgn) see Cormen chapter 2 -\/ exercises 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_a06f75de000ad4b9524116a029800ca26_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_adbb23b8a368e0d01cd2b450ad0be5efb}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Mult\-Inverse@{Get\-Mult\-Inverse}}
\index{Get\-Mult\-Inverse@{Get\-Mult\-Inverse}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Mult\-Inverse}]{\setlength{\rightskip}{0pt plus 5cm}{\bf c\-Perm\-Elem} c\-Perm\-Elem\-::\-Get\-Mult\-Inverse (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_adbb23b8a368e0d01cd2b450ad0be5efb}
returns the permutation inverse Complexity\-: O(n) 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_adbb23b8a368e0d01cd2b450ad0be5efb_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_a1b5d12f8fb6131643253f5ed3bad6c28}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Get\-Permutation\-Array@{Get\-Permutation\-Array}}
\index{Get\-Permutation\-Array@{Get\-Permutation\-Array}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Get\-Permutation\-Array}]{\setlength{\rightskip}{0pt plus 5cm}const std\-::vector$<$std\-::size\-\_\-t$>$\& c\-Perm\-Elem\-::\-Get\-Permutation\-Array (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a1b5d12f8fb6131643253f5ed3bad6c28}
get the underlying permutation array \hypertarget{classcPermElem_aa39ae9f1b4d3efd38616ff822caebbb9}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!Merge\-Inversions@{Merge\-Inversions}}
\index{Merge\-Inversions@{Merge\-Inversions}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{Merge\-Inversions}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Perm\-Elem\-::\-Merge\-Inversions (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator}]{begin, }
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator}]{begin\-\_\-right, }
\item[{std\-::vector$<$ std\-::size\-\_\-t $>$\-::iterator}]{end, }
\item[{std\-::size\-\_\-t \&}]{inversions}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [private]}}}\label{classcPermElem_aa39ae9f1b4d3efd38616ff822caebbb9}
equivalent to merge procedure from merge sort Complexity\-: O(n) \hypertarget{classcPermElem_a19da6e521f8adf3d252250f3836c563e}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{operator$\ast$}]{\setlength{\rightskip}{0pt plus 5cm}{\bf c\-Perm\-Elem} c\-Perm\-Elem\-::operator$\ast$ (
\begin{DoxyParamCaption}
\item[{const {\bf c\-Perm\-Elem} \&}]{perm}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_a19da6e521f8adf3d252250f3836c563e}
permutation mutiplication operator (doesn't work in the true mathematical meaning of composition-- aplies the first permutation first\-: A$\ast$\-B(x) -\/$>$ B(\-A(x)) ) Complexity\-: O(n) 

Here is the call graph for this function\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcPermElem_a19da6e521f8adf3d252250f3836c563e_cgraph}
\end{center}
\end{figure}


\hypertarget{classcPermElem_afa5694d1831e653f4cc3b12de6bb058e}{\index{c\-Perm\-Elem@{c\-Perm\-Elem}!rotate\-Left@{rotate\-Left}}
\index{rotate\-Left@{rotate\-Left}!cPermElem@{c\-Perm\-Elem}}
\subsubsection[{rotate\-Left}]{\setlength{\rightskip}{0pt plus 5cm}void c\-Perm\-Elem\-::rotate\-Left (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classcPermElem_afa5694d1831e653f4cc3b12de6bb058e}
rotate the elements of the array to the left represents a rotation of the regular polygon with n(size) sides !!!used to compute the cyclic and dihedral group 

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
permutation.\-h\end{DoxyCompactItemize}
